package customview.ike.com.customviewproject.Fragment;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ListView;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2017/11/30.
 */

public class FrangmentTwo extends BaseFragment {
    private ListView listView;
    private List<String> data=new ArrayList<>();
    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        listView=new ListView(getActivity());
        initData();
        return listView;
    }

    private void initData() {
        for (int i = 0; i <30 ; i++) {
            data.add("我是页面二，数据："+i);
        }
        listView.setAdapter(new ArrayAdapter<String>(getActivity(),android.R.layout.simple_list_item_1,data));
    }

    @Override
    public View getInnerView() {
        return listView;
    }
}
